<include file="public@header" />
</head>

<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li class="active"><a href="{:url('AdminBrand/index')}">汽车品牌管理</a></li>
            <li><a href="{:url('AdminBrand/add')}">添加汽车品牌</a></li>
        </ul>
        <form method="post" class="js-ajax-form margin-top-20">
            <div class="table-actions">
                <!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
            </div>
            <table class="table table-hover table-bordered table-list">
                <thead>
                    <tr>
                        <th width="50">ID</th>
                        <th>汽车品牌名称</th>
                        <th>图标</th>
                        <th>排序</th>
                        <th>状态</th>
                        <th width="160">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <empty name="brands">
                        <td colspan="4" class="text-center"> aOh! 暂时还没有添加汽车品牌! </td>
                    </empty>
                    <foreach name="brands" item="vo">
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.name}</td>
                            <td>
                                <notempty name="vo.icon">
                                    <a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo.icon)}');">
                                        <img class="fa " src="{:cmf_get_image_preview_url($vo.icon)}" width="50" style="background:black;">
                                    </a>
                                    <else/>
                                    <i class="fa fa-close fa-fw" title="未上传" style="color: red;"></i>
                                </notempty>
                            </td>
                            <td>{$vo.list_order}</td>
                            <td>{$arrStatus[$vo['status']]}</td>
                            <td>
                                <if condition="$vo['status'] eq 1">
                                    <a class="js-ajax-dialog-btn" href="{:url('AdminBrand/upStatus',['id'=>$vo['id'],'status'=>0])}">禁用</a>
                                    <else/>
                                    <a class="js-ajax-dialog-btn" href="{:url('AdminBrand/upStatus',['id'=>$vo['id'] ,'status'=>1])}">启用</a>
                                </if>
                                <a href="{:url('AdminBrand/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                                <a class="js-ajax-delete" href="{:url('AdminBrand/delete',['id'=>$vo['id']])}">删除</a>
                            </td>
                        </tr>
                    </foreach>
                </tbody>
            </table>
            <div class="table-actions">
                <!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
            </div>
        </form>
        <ul class="pagination">{$page|default=''}</ul>
    </div>
    <script src="__STATIC__/js/admin.js"></script>
</body>

</html>